]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Never close a notification banner that is about to show
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 8 Oct 2025 03:37:57 +0000 (05:37 +0200)
committerMarge Bot <marge-bot@gnome.org>
Tue, 14 Oct 2025 19:21:22 +0000 (19:21 +0000)
If a new notification is pushed (or the same is updated) in a very short
time GNOME shell may only show the last notification (or none).

This is because since commit 2801d0bf a notification that is about to
show (so in SHOWING state) may be considered expired, given that the
notification timeout won't be set until the show animation has
completed.

Thus, only consider the notification as expired when the notification is
in the shown state, but not in the showing one.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6529
Fixes: 2801d0bfe3 ("messageTray: Close SHOWING banner when its notification is destroyed")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3905>

js/ui/messageTray.js

index 64213c4118848b17cb9c3f028d8148d8be54de92..63bf26eafa701b662572ec0518819c0b03d23d63 100644 (file)
@@ -1077,6 +1077,7 @@ export const MessageTray = GObject.registerClass({
         } else if (this._notificationState === State.SHOWING ||
                    this._notificationState === State.SHOWN) {
             let expired = (this._userActiveWhileNotificationShown &&
+                           this._notificationState === State.SHOWN &&
                            this._notificationTimeoutId === 0 &&
                            this._notification.urgency !== Urgency.CRITICAL &&
                            !this._pointerInNotification) || this._notificationExpired;